<template>
	<view class="my_navbar" :class="[borderNone ? '' : 'birderTop' ]" >
		<view class="tab_item" :style="{height:navHeight + 'rpx'}" :class="{'current': current == index}" v-for="(item,index) in tabList" @click="tabclick(index)">
			<text > {{ item.name }}</text>
			<view class="line"></view>	
		</view>
	</view>
</template>

<script>
	export default {
		name:"my_navbar",
		data() {
			return {
				current: 0,
			};
		},
		methods: {
			tabclick(e) {
				this.current = e
				this.$emit('tabClick',this.current)
			},
			refMethod(e) {
				this.current = e
			}
		},
		props: {
			navHeight: 85,
			tabList: {
				type: Array,
				default: []
			},
			borderNone: {
				type: Boolean,
				default: false
			},
			clickCurrent: 0
		}
		
		
	}
</script>

<style lang="scss">
	.my_navbar {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding-top: 30rpx;
		background-color: #fff;
		
		box-sizing: border-box;
		.tab_item {
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			align-items: center;
			
			font-size: 26rpx;
			color: #333333;
			.line {
				width: 100%;
				height: 6rpx;
				margin-top: 22rpx;
				border-radius: 3rpx;
				background-color: #fff;
			}
			
		}
		.current {
			color: #0156F6;
			.line {
				background-color: #0156F6;
			}
		}
		
		
	}
	.birderTop {
		border-top: 1rpx solid rgba(0, 0, 0, 0.05);
	}
</style>